# from gevent import monkey
# monkey.patch_all()

# import gevent,random
import asyncio

@asyncio.coroutine
def test():
    for i in range(10):
       yield from print(i)

tasks = []
i=0

while i <= 10:
    tasks.append(test())
    i+=1

loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait(tasks))
loop.close()